Xbasic

Array get_fields Method

Syntax

dim fields as C = <array>.get_fields()

Returns

fieldsCharacter

Returns a CR-LF delimited list of fields for a property array.

Description

Gets a CR-LF delimited list of fields for a property array.

Discussion

The <array>.get_fields() method creates a CR-LF delimited list of all fields in a property array. This method can only be used with property arrays.

Example

dim people[0] as p
i = people.append()
people[i].name = "Janet"
people[i].age = 37
i = people.append()
people[i].name = "Barry"
people[i].age = 67
people[i].city = "Los Angeles"
i = people.append()
people[i].name = "Liza"
people[i].age = 27
people[i].state = "AL"

? people.get_fields()
= name
age
city
state

format = stritran(people.get_fields(),crlf()," | ")

? people.dump_properties(format)
= Janet | 37 |  | 
Barry | 67 | Los Angeles | 
Liza | 27 |  | AL